home *** CD-ROM | disk | FTP | other *** search
- PXFSETSID(3F) Last changed: 1-6-98
-
-
- NNAAMMEE
- PPXXFFSSEETTSSIIDD - Creates a new session for a calling process
-
- SSYYNNOOPPSSIISS
- SSUUBBRROOUUTTIINNEE PPXXFFSSEETTSSIIDD ((_i_s_i_d,, _i_e_r_r_o_r))
- IINNTTEEGGEERR _i_s_i_d,, _i_e_r_r_o_r
-
- IIMMPPLLEEMMEENNTTAATTIIOONN
- UNICOS, UNICOS/mk, and IRIX systems
-
- DDEESSCCRRIIPPTTIIOONN
- On IRIX systems, this routine is in lliibbffoorrttrraann..ssoo which is linked by
- default when compiling programs with the MIPSpro 7 Fortran 90 compiler
- or when compiling programs with the --ccrraayylliibbss option to the MIPSpro
- 7.2 F77 compiler.
-
- The PPXXFFSSEETTSSIIDD routine uses the sseettssiidd(2) system call to create a new
- session for the calling process. The calling process must not be the
- process leader for PPXXFFSSEETTSSIIDD to be successful.
-
- After the successful completion of PPXXFFSSEETTSSIIDD, the calling process will
- be the session leader for the new session and the process group leader
- for the new process group. The calling process also will have no
- controlling terminal.
-
- When using the CF90 compiler or MIPSpro 7 Fortran 90 compiler on
- UNICOS, UNICOS/mk, or IRIX systems, all arguments must be of default
- kind unless documented otherwise. On UNICOS and UNICOS/mk, default
- kind is KKIINNDD==88 for integer, real, complex, and logical arguments; on
- IRIX, the default kind is KKIINNDD==44.
-
- The following is a list of arguments for this routine:
-
- _i_s_i_d An output integer variable for the new process group ID of
- the calling process.
-
- _i_e_r_r_o_r An output integer variable that contains zero if PPXXFFSSEETTSSIIDD
- was successful or nonzero if PPXXFFSSEETTSSIIDD was not successful.
-
- This routine may return the EEPPEERRMM error value if the calling process
- is already a process group leader, or the calling process group ID of
- a process other than the calling process matches the process ID of the
- calling process.
-
- EEXXAAMMPPLLEESS
- In this example, PPXXFFFFOORRKK(3F) is called to create a child process,
- which calls PPXXFFSSEETTSSIIDD to create a new session. The child writes the
- value of _i_e_r_r_o_r to Fortran unit 10 and stops. After the fork, the
- parent process waits for the child to finish execution, and then reads
- from Fortran unit 10. If the value read in from unit 10 is not equal
- to zero, the child's call to PPXXFFSSEETTSSIIDD was unsucessful.
-
- program pxftest
- integer isid, iretpid, istat, ierror, i
-
- CALL PXFFORK(iretpid,ierror)
- if (ierror .ne. 0) then
- print *,'FAILED: PXFFORK call with error = ',ierror
- else
- if (iretpid .eq. 0) then
- CALL PXFSETSID(isid, ierror)
- write (10,*) ierror
- stop
- else
- CALL PXFWAIT(istat, iretpid, ierror)
- read (10,*) i
- if (i .eq. 0) then
- print *,'PASSED: PXFSETSID call under normal conditions'
- else
- print *,'FAILED: PXFSETSID call with error = ',i
- endif
- endif
- endif
-
- SSEEEE AALLSSOO
- sseettssiidd(2)
- PPXXFFFFOORRKK(3F)
-
- _A_p_p_l_i_c_a_t_i_o_n _P_r_o_g_r_a_m_m_e_r'_s _L_i_b_r_a_r_y _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication SR-
- 2165, for the printed version of this man page.
-
-